package com.example.robertluozizhao.framecollectdemo.adapter;

import androidx.recyclerview.widget.RecyclerView;
import android.view.ViewGroup;

import com.example.robertluozizhao.framecollectdemo.R;
import com.example.robertluozizhao.framecollectdemo.adapter.base.BaseReycleAdapter;
import com.example.robertluozizhao.framecollectdemo.adapter.holder.NormalTextHolder;

import java.util.List;

/**
 * Created by Lzz on 7/27/2019.
 */

public class NormalTextAdapter extends BaseReycleAdapter<String> {

    public NormalTextAdapter(List<String> sData) {
        super(sData);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  /*      // 实例化展示的view
        View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.flex_test, parent, false);
*/
        // 实例化viewholder
        NormalTextHolder viewHolder = new NormalTextHolder(R.layout.item_sticky_head,parent);

        return viewHolder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        NormalTextHolder holder1 = (NormalTextHolder) holder;
        holder1.textView.setText(sData.get(position));
    }
}
